#ifndef __expression_H__
#define __expression_H__

namespace syntax_analysis
{
	
#define UNKNOWN			(-3)
#define EXP_ALL			(-1)
#define EXP_ONE_MORE	(-2)
	
	class expression;
	
	enum exp_opt
	{
		OPT_NONE,
			OPT_ADD,
			OPT_SUB,
			OPT_MUL,
			OPT_DIV,
			OPT_MOD,
	};
	
	enum exp_opd_type
	{
		OPD_RAW,
			OPD_EXPRESSION,
	};
	
	class exp_opd
	{
	public:
		exp_opd();
		exp_opd( int opd );
		exp_opd( expression *opd );
		virtual ~exp_opd();

	public:
		int get_value();

		void set_opd( int opd );
		void set_opd( expression *opd );

	private:
		exp_opd_type m_type;
		int m_opd_int;
		expression *m_opd_exp;
	};
	
	class expression
	{
	public:
		expression();
		expression( exp_opt opt, exp_opd *opd1, exp_opd *opd2 );
		virtual ~expression( );
		
	public:
		int get_value();
		void set_opt( exp_opt opt );
		void set_opd1( exp_opd *opd );
		void set_opd2( exp_opd *opd );
		
	private:
		exp_opt m_opt;
		exp_opd *m_opd1;
		exp_opd *m_opd2;
	};
	
}
	
#endif // __expression_h__
